/*
 * rc_ppm.h
 *
 *  Created on: Jan 25, 2014
 *      Author: bohni
 */

#ifndef RC_PPM_H_
#define RC_PPM_H_

#include <avr/io.h>
#include <util/delay.h>


////////////////////////////////////////////////////
// PORT

#define SIGNAL_OUT_DDR 			DDRB
#define SIGNAL_OUT_PIN			PB0
#define SIGNAL_OUT_PORT			PORTB

#define SIGNAL_PIN_HIGH			SIGNAL_OUT_PORT |= (1<<SIGNAL_OUT_PIN);
#define SIGNAL_PIN_LOW			SIGNAL_OUT_PORT &= ~(1<<SIGNAL_OUT_PIN);

#define INVERT_SIGNAL


// SIGNAL TIMING
#define STOP_TIME_US			300
#define MIN_TIME_US				700

#define SIGNAL_US_PER_LSB		10

#define FRAME_LENGTH_MS			22


//////////////////////////////////////////////////////////
void rc_ppm_init();

void send_rc_ppm( uint8_t value_array[], uint8_t nr_values );



#endif /* RC_PPM_H_ */
